package yyy0413;

public class Triangle extends GeometricObject {
        // 定义一个直角三角形，b为斜边
        private double b;
        private double a;

        private double c;
        public Triangle() {
        }

        public Triangle(double a, double b, double c) {
            this.a = a;
            this.b = b;
            this.c = c;

        }

        /** Return width */
        public double getA() {
            return a;
        }

        /** Set a new width */
        public void setA(double a) {
            this.a = a;
        }

        /** Return height */
        public double getB() {
            return b;
        }

        /** Set a new height */

        public void setB(double b) {
            this.b = b;
        }

        public double getC() {
            return c;
        }

        /** Set a new width */
        public void setC(double c) {
            this.c = c;
        }

        @Override /** Return area */
        public double getArea() {
            return a+b+c;
        }

        @Override /** Return perimeter */
        public double getPerimeter() {
            return a*c/2;
        }

}
